package com.hexinfo.dmpro.monitor.controller;

import com.hexinfo.dmpro.common.base.Page;
import com.hexinfo.dmpro.monitor.model.serviceparam.CmServiceParamReq;
import com.hexinfo.dmpro.monitor.service.serviceparam.CmServiceParamService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.*;
import java.util.stream.Stream;

/**
 * 集群参数对比功能
 * @author peng
 * @date 2022/12/7 14:09
 */

@RestController
@RequestMapping("/monitor_api/cmServiceParam")
public class CmServiceParamController {

    @Autowired
    private CmServiceParamService cmServiceParamService;

    /**
     * 参数详情 首页列表 参数告警信息查询
     * @param page
     * @param req
     * @return
     */
    @GetMapping(value = "/selParamWarn")
    public ResponseEntity<Object> selParamWarn(Page page, @Param("int") int current, CmServiceParamReq req) {
        page.setPageIndex(current-1);
        return new ResponseEntity<>(cmServiceParamService.selParamWarn(page, req), HttpStatus.OK);
    }
}
